package cn.itsource.mapper;

import cn.itsource.domain.ResourceLock;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ResourceLockMapper {
    @Insert("insert into resource_lock(resource_name,owner,`desc`,update_time) values(#{resource_name},#{owner},#{desc},#{update_time})")
    void save(ResourceLock resourceLock);
    @Select("select * from resource_lock where resource_name = #{resourceName} for update")
    ResourceLock loadByResourceName(String resourceName);

    @Delete("delete from resource_lock where resource_name = #{resourceName}")
    void removeByResourceName(String resourceName);
}
